package org.example.day20240905.view;

import org.example.day20240905.dao.RegisterDao;
import org.example.day20240905.model.User;
import org.example.day20240905.util.GlobalInput;

import java.util.Scanner;

public class RegisterView {
    public User register() {
        Scanner scanner = GlobalInput.getScanner();
        User user = new User();
        System.out.println("请输入用户名：");
        String userName = scanner.nextLine();
        user.setUserName(userName);
        System.out.println("请输入密码：");
        String passWord = scanner.nextLine();
        user.setPassWorld(passWord);
        RegisterDao registerDao = new RegisterDao();

        return registerDao.register(user);
    }
}